---
category: String
created: '2021-02-21'
title: Decapitalize a string
updated: '2021-10-13'
---

**JavaScript version**

```js decapitalize.js
const decapitalize = (str) => `${str.charAt(0).toLowerCase()}${str.slice(1)}`;

// Or
const decapitalize = ([first, ...rest]) => `${first.toLowerCase()}${rest.join('')}`;
```

**TypeScript version**

```ts decapitalize.ts
const decapitalize = (str: string): string => `${str.charAt(0).toLowerCase()}${str.slice(1)}`;

// Or
const decapitalize = ([first, ...rest]: string): string => `${first.toLowerCase()}${rest.join('')}`;
```

**Examples**

```js examples.js
decapitalize('Hello world'); // 'hello world'
```
